import React from "react";
import store from "../../redux/store";
import { increAction, decreAction,asyncIncreAction } from "../../redux/reducers/countReducer";

export default function Control() {
  return (
    <>
      <button
        onClick={() => {
          //更新状态
          store.dispatch(increAction(1));
        }}
      >
        新增
      </button>
      <button
        onClick={() => {
          store.dispatch(decreAction(1));
        }}
      >
        减少
      </button>
      <button onClick={() => {
        store.dispatch(asyncIncreAction(10))
      }}>1秒新增 10</button>
    </>
  );
}
